<!DOCTYPE html>
 <html lang="en">
 <head>
 <meta charset="UTF-8">
 <title>leaves</title>
 </head>
 <body>
 <form action="" method="get">
   <select name="status" id="status">
 {% if status == -1 %}
 <option value="-1" selected>选择类型</option>
 {% else %}
 <option value="-1">选择类型</option>
 {% endif %}
     {% for i in leave_type %}
 {# 根据status 判断 默认选中哪个 标签#}
 {% if i.id == status %}
 <option selected value="{{ i.id }}">{{ i.tname }}--({{ i.leave_set.all.count }})
 </option>
 {% else %}
 <option value="{{ i.id }}">{{ i.tname }}--({{ i.leave_set.all.count }})
 </option>
 {% endif %}
   {% endfor %}
   </select>
   <input type="submit" value="过滤">
 </form>
 <table cellspacing="o" cellpadding="0" border="1">
     <tr>
         <td>姓名</td>
         <td>事由</td>
         <td>状态</td>
         <td>类型</td>
         <td>操作</td>
     </tr>
     {% for leaf in leaves %}
         <tr>
            <td>{{ leaf.stu_name }}</td>
            <td> {{ leaf.content }}&nbsp;&nbsp;</td>
            <td>{{ leaf.status }} {{ leaf.get_status_display }}</td>
            <td> {{ leaf.tid.tname }}</td>
            <td> <a href="{% url 'app1:passs' leaf.id %}">通过</a>&nbsp<a href="{% url 'app1:pas' leaf.id %}">不通过</a></td>
         </tr>






 {% endfor %}
 </table>
 <br>

 <a href="{% url 'app1:show' %}?page={{ page|add:-1 }}&status={{ status }}">上一页</a> <a href="#">当前页{{ page }}</a>
    <a href="{% url 'app1:show' %}?page={{ page|add:1 }}&status={{ status }}">下一页</a>


 </body>
 </html>
